#ifndef __GfxDriver_VertexInput_h__
#define __GfxDriver_VertexInput_h__

#include "Core/BasicTypes.h"

#include "GfxDriver/VertexStreamDecl.h"
#include "GfxDriver/IndexStreamDecl.h"

namespace Orca {

	//--------------------------------------------------------------------------
	class VertexInput {

	public:
		virtual ~VertexInput() {}

		virtual void bind() = 0;

		virtual VertexStreamDecl& append(
			  VertexBuffer *vbuf
			, uint32 offsetInBytes
			, uint32 stride) = 0;

		virtual IndexStreamDecl& append(
			  IndexBuffer *ibuf
			, uint32 offsetInBytes
			, IndexType indexType) = 0;
	};
	
	//--------------------------------------------------------------------------
	class AbstractVertexInput : public VertexInput {

	public:
		virtual ~AbstractVertexInput() {}

		virtual VertexStreamDecl& append(
			  VertexBuffer *vbuf
			, uint32 offsetInBytes
			, uint32 stride) {

			mVStreamDecl.push_back( VertexStreamDecl(vbuf, offsetInBytes, stride) );
			return mVStreamDecl.back();
		}

		virtual IndexStreamDecl& append(
			  IndexBuffer *ibuf
			, uint32 offsetInBytes
			, IndexType indexType) {

			mIStreamDecl.push_back( IndexStreamDecl(ibuf, offsetInBytes, indexType) );
			return mIStreamDecl.back();
		}

	protected:
		std::vector<VertexStreamDecl> mVStreamDecl;
		std::vector<IndexStreamDecl> mIStreamDecl;
	};
}

#endif	// __GfxDriver_VertexInput_h__